package com.rybbaby.tss.tests;

import com.rybbaby.tss.core.utils.StringUtils;
import com.rybbaby.tss.front.tssClasses.entity.TssClasses;
import org.apache.poi.ss.formula.functions.T;

import javax.persistence.Column;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

/**
 * @author 谢进伟
 * @description 根据某一个类生成请求参数
 * @createDate 2018-01-22 16:14
 */
public class GenParamsForClass {
    public static void main(String[] args) throws NoSuchMethodException {
        Class<?> cls = TssClasses.class;
        Field[] fields = cls.getDeclaredFields();
        for (Field field : fields) {
            //|id |  否  |    string   |    主键   |
            String fieldName = field.getName();
            String typeName = field.getType().getSimpleName();
            String getterOrSetterSuffix = StringUtils.getGetterOrSetterSuffix(fieldName);
            StringBuffer line = new StringBuffer("|\t").append(fieldName).append("\t|\t").append("否").append("\t|\t").append(typeName).append("\t|\t").append("").append("\t|");
            System.out.println(line);
        }
    }
}
